package com.kaka.bus.api;


import com.kaka.bus.BuildConfig;
import com.kaka.bus.bean.BankBean;
import com.kaka.bus.bean.BankManagerBean;
import com.kaka.bus.bean.BasicInfo;
import com.kaka.bus.bean.BorrowDetailBean;
import com.kaka.bus.bean.BorrowDeteil;
import com.kaka.bus.bean.BorrowList;
import com.kaka.bus.bean.BpmList;
import com.kaka.bus.bean.CardBean;
import com.kaka.bus.bean.City;
import com.kaka.bus.bean.CommissionBean;
import com.kaka.bus.bean.CouponBean;
import com.kaka.bus.bean.DrainProductBean;
import com.kaka.bus.bean.DrainageBean;
import com.kaka.bus.bean.HttpWrapper;
import com.kaka.bus.bean.HttpWrapperList;
import com.kaka.bus.bean.IDCardFrontBean;
import com.kaka.bus.bean.InfoBean;
import com.kaka.bus.bean.InviteBean;
import com.kaka.bus.bean.InviteRule;
import com.kaka.bus.bean.Jinhudai;
import com.kaka.bus.bean.LoanBean;
import com.kaka.bus.bean.LoanProApplyBean;
import com.kaka.bus.bean.LoginBean;
import com.kaka.bus.bean.MessageBean;
import com.kaka.bus.bean.MoneyRecordBean;
import com.kaka.bus.bean.NamePhoneBean;
import com.kaka.bus.bean.OrderBean;
import com.kaka.bus.bean.PactBean;
import com.kaka.bus.bean.PayBean;
import com.kaka.bus.bean.ProduceBean;
import com.kaka.bus.bean.ProductDetailBean;
import com.kaka.bus.bean.ProductInfo;
import com.kaka.bus.bean.QuestionBean;
import com.kaka.bus.bean.RepayBean;
import com.kaka.bus.bean.RepayInfo;
import com.kaka.bus.bean.Rolling;
import com.kaka.bus.bean.ShareBean;
import com.kaka.bus.bean.Single;
import com.kaka.bus.bean.Status;
import com.kaka.bus.bean.User;
import com.kaka.bus.bean.Version;
import com.kaka.bus.constant.Constant;

import java.util.List;
import java.util.Map;

import io.reactivex.Flowable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * Created by zhangqi on 2016/9/12.
 */
public interface Api {

    String BASE_URL = BuildConfig.API_HOST;

    /**
     * 登录
     *
     * @param phone
     * @param pwd
     * @return
     */
    @FormUrlEncoded
    @POST("user/userLogin")
    Flowable<HttpWrapper<LoginBean>> login(@Field("phone") String phone, @Field("password") String pwd, @Field("tokenKey") String tokenKey, @Field("device") String device, @Field("systemVersion") String systemVersion, @Field("phoneType") String phoneType);

    /**
     * 登录
     *
     * @param phone
     * @return
     */
    @FormUrlEncoded
    @POST("user/userLoginByAuthCode")
    Flowable<HttpWrapper<LoginBean>> loginByAuthCode(@Field("phone") String phone, @Field("authCode") String authCode, @Field("tokenKey") String tokenKey, @Field("device") String device, @Field("systemVersion") String systemVersion, @Field("phoneType") String phoneType);

    /**
     * 注册获取验证码
     *
     * @param phone
     * @return
     */
    @FormUrlEncoded
    @POST("user/getCode")
    Flowable<HttpWrapper<String>> getCode(@Field("phone") String phone, @Field("tokenKey") String tokenKey, @Field("event") String event, @Field("device") String device);


    /**
     * 支付获取验证码
     *
     * @param phone
     * @return
     */
    @FormUrlEncoded
    @POST("user/getPayCode")
    Flowable<HttpWrapper<Single>> getPayCode(@Field("phone") String phone, @Field("tokenKey") String tokenKey, @Field("event") String event, @Field("device") String device, @Field("bankNum") String bankNum);

    @FormUrlEncoded
    @POST("user/checkInviteCode")
    Flowable<HttpWrapper<String>> checkInviteCode(@Field("phone") String phone, @Field("verifyCode") String verifyCode);

    /**
     * 注册
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("user/userRegister")
    Flowable<HttpWrapper<String>> regist(@Field("phone") String phone, @Field("password") String pwd, @Field("validateCode") String validateCode);

    /**
     * 忘记密码
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("user/updatePassword")
    Flowable<HttpWrapper<String>> updatePassword(@Field("phone") String phone, @Field("password") String pwd, @Field("verifyCode") String verifyCode);

    /**
     * 读身份证正面
     *
     * @return
     */
    @Multipart
    @POST("loan/cardOcr")
    Flowable<HttpWrapper<IDCardFrontBean>> readIdCardInfo(@Part(Constant.USERID) String per_id, @Part("token") String token, @Part("md5sign") String md5sign, @PartMap Map<String, RequestBody> map);

    /**
     * 借款记录列表
     *
     * @param per_id
     * @param currentPage
     * @param size
     * @return
     */
    @FormUrlEncoded
    @POST("user/getMyBorrowList")
    Flowable<HttpWrapper<List<BorrowList>>> getMyBorrowList(@Field(Constant.USERID) String per_id, @Field("nowPage") int currentPage, @Field("pageSize") int size, @Field("token") String token);

    @FormUrlEncoded
    @POST("loan/cancelAskBorrow")
    Flowable<HttpWrapper<List<BorrowList>>> cancelRquest(@Field(Constant.USERID) String per_id, @Field("borr_id") String borr_id, @Field("token") String token);


    /**
     * 身份证正面
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("loan/insertCardInfoz")
    Flowable<HttpWrapper<String>> commitIdcardz(@FieldMap Map<String, String> map, @Field("token") String token);


    /**
     * 判断手机号是否被注册
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("user/getPersonByPhone")
    Flowable<HttpWrapper<String>> phoneIsExist(@Field("phone") String phone);

    @FormUrlEncoded
    @POST()
    Flowable<HttpWrapper<Version>> getVersionInfo(@Url String url, @Field("clientName") String clientName, @Field("versionName") String versionName, @Field("millisecond") long millisecond);

    /**
     * 身份证正面
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("loan/insertCardInfof")
    Flowable<HttpWrapper<String>> commitIdcardf(@FieldMap Map<String, String> map, @Field("token") String token);


    /**
     * 提交本地手机通讯录
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getPhoneList")
    Flowable<HttpWrapper<String>> commitContact(@Field(Constant.USERID) String per_id, @Field("phone_list") String contact);

    @FormUrlEncoded
    @POST("charge/apply")
    Flowable<String> chargeApply(@Field("event") String event, @Field("productId") String productId, @Field("bannerId") String bannerId, @Field("device") String device, @Field("perId") String perId, @Field("chargeProductId") String chargeProductId);


    /**
     * 判断是否完成认证
     *
     * @param userId
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("loan/checkBpm")
    Flowable<HttpWrapper<Status>> checkNode(@Field(Constant.USERID) String userId, @Field("token") String token);

    /**
     * 个人信息
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("loan/insertPrivateInfo")
    Flowable<HttpWrapper<String>> commitPersonInfo(@FieldMap Map<String, String> map, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 得到城市
     *
     * @return
     */
    @POST("loan/getCity")
    Flowable<City> getCity();


    /**
     * 人脸识别
     *
     * @return
     */
    @Multipart
    @POST("loan/faceVerify")
    Flowable<HttpWrapper<String>> commitLiveness(@Part(Constant.USERID) String per_id, @Part("token") String token, @Part("delta") String delta, @PartMap Map<String, RequestBody> map);

    /**
     * 判断手机号是否被注册
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("user/checkSmsCode")
    Flowable<HttpWrapper<String>> checkSms(@Field("phone") String phone, @Field("smsCode") String smsCode, @Field("token") String token);

    /**
     * @param userId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("loan/bpmList")
    Flowable<HttpWrapper<List<BpmList>>> getBpmList(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("productId") String productId);

    @FormUrlEncoded
    @POST("home/loan")
    Flowable<HttpWrapper<List<LoanBean>>> getHomeLoan(@Field("device") String device, @Field("version") String version);

    @FormUrlEncoded
    @POST("drain/getAllDrainProduct")
    Flowable<HttpWrapper<List<DrainProductBean>>> getDrain(@Field("page") int page, @Field("pageSize") int pageSize);


    @FormUrlEncoded
    @POST("home/loan/Product")
    Flowable<HttpWrapper<List<ProductDetailBean>>> getLoanProduct(@Field("per_id") String per_id, @Field("token") String token, @Field("device") String device, @Field("productId") int productId, @Field("version") String version);

    @FormUrlEncoded
    @POST("drain/getProduct")
    Flowable<HttpWrapper<ProductDetailBean>> getDrainProduct(@Field("per_id") String per_id, @Field("token") String token, @Field("device") String device, @Field("version") String version, @Field("tokenKey") String tokenKey, @Field("productId") String productId);

    @FormUrlEncoded
    @POST("drain/getTailProduct")
    Flowable<HttpWrapper<List<DrainProductBean>>> getTailProduct(@Field("per_id") String per_id);


    @FormUrlEncoded
    @POST("user/isVIPn")
    Flowable<HttpWrapper<String>> checkVip(@Field(Constant.USERID) String userId);

    @FormUrlEncoded
    @POST("loan/signingBorrow")
    Flowable<HttpWrapper<String>> signingBorrow(@Field(Constant.USERID) String userId, @Field("borr_id") String borrId, @Field("amount") String money, @Field("token") String token);

    /**
     * banner列表
     *
     * @return
     */
    @GET("product/getBanner")
    Flowable<HttpWrapper<BasicInfo>> getBasicInfo();

    /**
     * 充值接口
     *
     * @param userId
     * @param repayMoney
     */
    @FormUrlEncoded
    @POST("rechage/doRechage")
    Flowable<HttpWrapper<RepayBean>> doRepay(@Field(Constant.USERID) String userId, @Field("amount") String repayMoney, @Field("rechargeBizType") String bizType);

    /**
     * 个人信息
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("user/getPersonInfo")
    Flowable<HttpWrapper<User>> getPersonInfo(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 根据Userid 拿到常见问题
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("user/getQuestion")
    Flowable<HttpWrapper<List<QuestionBean>>> getQuestion(@Field(Constant.USERID) String userId, @Field("token") String token);

    /**
     * 银行卡列表
     *
     * @return
     */
    @FormUrlEncoded
    @POST("loan/personBanks")
    Flowable<HttpWrapper<List<BankManagerBean>>>
    getBankCardList(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);


    /**
     * 消息列表
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("user/getMessageByUserId")
    Flowable<HttpWrapper<List<MessageBean>>> getMessageByUserId(@Field(Constant.USERID) String userId, @Field("nowPage") int nowPage, @Field("pageSize") int pageSize
            , @Field("token") String token);


    /**
     * 更新消息的已读未读
     *
     * @param per_id
     * @param messageId
     * @return
     */
    @FormUrlEncoded
    @POST("user/updateMessageStatus")
    Flowable<HttpWrapper<String>> updateMessageStatus(@Field(Constant.USERID) String per_id, @Field("messageId") String messageId, @Field("token") String token);

    /**
     * 用户建议
     *
     * @param per_id
     * @param content
     * @return
     */
    @FormUrlEncoded
    @POST("user/userFeedBack")
    Flowable<HttpWrapper<String>> userFeedBack(@Field(Constant.USERID) String per_id, @Field("content") String content, @Field("token") String token);

    /**
     * 单个借款详情
     *
     * @return
     */
    @FormUrlEncoded
    @POST("user/getProdModeByBorrId")
    Flowable<HttpWrapper<BorrowDeteil>> getBorrowDeteil(@Field("borrId") String borrowId);


    /**
     * 资金记录
     *
     * @param userId
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("user/perAccountLog")
    Flowable<HttpWrapper<List<MoneyRecordBean>>> perAccountLog(@Field(Constant.USERID) String userId, @Field("nowPage") int currentPage, @Field("pageSize") int size, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 优惠券列表
     *
     * @param userId
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("user/getMyCoupon")
    Flowable<HttpWrapper<List<CouponBean>>> getMyCoupon(@Field(Constant.USERID) String userId, @Field("couponStatus") String couponStatus, @Field("nowPage") int currentPage, @Field("pageSize") int size
            , @Field("token") String token, @Field("md5sign") String md5sign);


    /**
     * 查看用户是否能使用列表中的优惠券
     *
     * @param userId
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("loan/useCoupon")
    Flowable<HttpWrapper<String>> useCoupon(@Field(Constant.USERID) String userId, @Field("md5sign") String md5sign);

    /**
     * 激活优惠券
     *
     * @param userId
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("loan/activateCoupon")
    Flowable<HttpWrapper<CouponBean>> avtivateCoupon(@Field(Constant.USERID) String userId, @Field("coupon_id") String couponId, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 创建认证
     *
     * @param userId
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("loan/insertPerBpm")
    Flowable<HttpWrapper<String>> createNode(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("md5sign") String md5sign);


    /**
     * 银行卡
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("loan/insertBankInfo")
    Flowable<HttpWrapper<String>> commitBankInfo(@FieldMap Map<String, String> map, @Field("tokenKey") String tokenKey, @Field("token") String token, @Field("device") String device);

    /**
     * 拿到自己的姓名和身份证号
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getIDNumber")
    Flowable<HttpWrapper<InfoBean>> getNameAndIdcard(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 提交手机服务密码
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getPhonePwd")
    Flowable<HttpWrapper<String>> commitPhonePwd(@Field(Constant.USERID) String userId, @Field("phone_pwd") String phone_pwd, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 提交手机服务密码
     *
     * @return
     */
    @FormUrlEncoded
    @POST("RC/risk")
    Flowable<HttpWrapper<String>> commitPhonePwdRc(@FieldMap Map<String, String> map);

    /**
     * 签约页面的信息
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getSignInfo")
    Flowable<HttpWrapper<PactBean>> getSignInfo(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 合同变为已签约
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/signingBorrow")
    Flowable<HttpWrapper<String>> commitPact(@Field(Constant.USERID) String userId, @Field("borr_id") String borr_id
            , @Field("token") String token);

    /**
     * 增加第三方接口调用次数
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/addCount")
    Flowable<HttpWrapper<String>> addCount(@Field(Constant.USERID) String userId, @Field("type") String type
            , @Field("count") String count, @Field("status") String status, @Field("md5sign") String md5sign);

    /**
     * 获取节点认证情况
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getNodeStatus")
    Flowable<HttpWrapper<String>> getNodeStatus(@Field(Constant.USERID) String userId, @Field("node_id") String node_id, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 合同
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getContract")
    Flowable<HttpWrapper<String>> getContract(@Field(Constant.USERID) String userId, @Field("borr_id") String borr_id, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 修改密码
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("user/personUpdatePassword")
    Flowable<HttpWrapper<String>> personUpdatePassword(@Field(Constant.USERID) String userId, @Field("oldPassword") String oldPassword
            , @Field("newPassword") String newPassword, @Field("tokenKey") String tokenKey, @Field("token") String token, @Field("device") String device);

    /**
     * 还款
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("callback/repayment")
    Flowable<HttpWrapper<String>> repayment(@Field(Constant.USERID) String userId, @Field("amount") String amount
            , @Field("conctact_id") String conctact_id, @Field("bank_id") String bank_id
            , @Field("cardNo") String cardNo, @Field("tokenKey") String tokenKey, @Field("token") String token, @Field("device") String device);

    /**
     * 还款的详情
     *
     * @param userId
     * @return
     */
    @GET("user/getRepaymentDetails")
    Flowable<String> getRepaymentDetails(@Query(Constant.USERID) String userId, @Query("borr_id") String borr_id, @Query("token") String token, @Query("type") int type);

    /**
     * 提交手机服务密码
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getVerifiCode")
    Flowable<HttpWrapper<String>> comitServiceYzm(@Field(Constant.USERID) String userId, @Field("VerifiCode") String yzm
            , @Field("ID") String id, @Field("QueryPwd") String QueryPwd, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 选择产品 -- 获取金额
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getProductsMoney")
    Flowable<HttpWrapper<List<String>>> getProduceMoney(@Field(Constant.USERID) String userId, @Field("md5sign") String md5sign);

    /**
     * 根据Userid 拿到姓名和手机号码
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getNamePhone")
    Flowable<HttpWrapper<NamePhoneBean>> getNamePhone(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 取消申请中的订单
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/cancelAskBorrow")
    Flowable<HttpWrapper<String>> cancelAskBorrow(@Field(Constant.USERID) String userId, @Field("borr_id") String borr_id, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 选择产品 -- 获取天数
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getProductsday")
    Flowable<HttpWrapper<List<String>>> getProduceTime(@Field(Constant.USERID) String userId, @Field("money") String money, @Field("md5sign") String md5sign);

    /**
     * 选择产品 -- 获取结果
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getProductCharge")
    Flowable<HttpWrapper<ProduceBean>> getProduceInfo(@Field(Constant.USERID) String userId, @Field("money") String money, @Field("day") String day, @Field("md5sign") String md5sign);

    /**
     * 获取银行列表
     *
     * @param
     * @return
     */
    @POST("pay/getBankList")
    Flowable<HttpWrapper<List<BankBean>>> getBankList();

    /**
     * 首页进去 判断节点
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getBorrStatus")
    Flowable<HttpWrapper<String>> getNodeState(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);

    /**
     * 首页进去 判断节点
     *
     * @param
     * @return
     */
    @FormUrlEncoded
    @POST("loan/borrowProduct")
    Flowable<HttpWrapper<String>> createProduct(@Field(Constant.USERID) String per_id, @Field("productId") String productId
            , @Field("borrAmount") String amount, @Field("token") String token);


    /**
     * 拿到用户手机号
     *
     * @param per_id
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getPhoneInfo")
    Flowable<HttpWrapper<String>> getUserPhone(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);

    /**
     * 取消订单
     *
     * @param orderId
     * @param token
     * @param info
     * @return
     */
    @FormUrlEncoded
    @POST("user/canOfOrder")
    Flowable<HttpWrapper<String>> canOfOrder(@Field(Constant.USERID) String orderId, @Field("token") String token, @Field("info") String info, @Field("md5sign") String md5sign);

    /**
     * 主页的滚动条
     *
     * @param per_id
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getRolling")
    Flowable<HttpWrapper<Rolling>> getRolling(@Field(Constant.USERID) String per_id, @Field("token") String token, @Field("device") String device, @Field("version") String version);

    /**
     * 完成认证
     *
     * @param per_id
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("loan/bpmFinish")
    Flowable<HttpWrapper<String>> NodeOk(@Field(Constant.USERID) String per_id, @Field("token") String token, @Field("md5sign") String md5sign);

    /**
     * 完成认证
     *
     * @param per_id
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("loan/bpmFinish")
    Flowable<HttpWrapper<String>> NodeOk(@Field(Constant.USERID) String per_id, @Field("token") String token);

    /**
     * 拿到身份证照片
     *
     * @param per_id
     * @return
     */
    @FormUrlEncoded
    @POST("loan/getCardz")
    Flowable<HttpWrapper<String>> getIdcardImage(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);

    /**
     * 得到订单信息
     *
     * @param borrId
     * @return
     */
    @FormUrlEncoded
    @POST("user/getProdModeByBorrId")
    Flowable<HttpWrapper<BorrowDetailBean>> getProdModeByBorrId(@Field("borrId") String borrId, @Field("md5sign") String md5sign);

    /**
     * 得到订单信息
     *
     * @return
     */
    @FormUrlEncoded
    @POST("loan/repayInfo")
    Flowable<HttpWrapper<RepayInfo>> getRepayInfo(@Field(Constant.USERID) String per_id, @Field("token") String token);

    /**
     * 提交用户手机评估
     *
     * @param userId
     * @param phoneInfo
     * @param device
     * @param sequence
     * @return
     */
    @FormUrlEncoded
    @POST("phone/savePhoneInfo")
    Flowable<HttpWrapper<String>> commitPhoneInfo(@Field(Constant.USERID) String userId, @Field("phoneInfo") String phoneInfo,
                                                  @Field("device") String device, @Field("sequence") String sequence);

    /**
     * 认证支付接口
     *
     * @return
     */
    @FormUrlEncoded
    @POST("payCenter/agentDeduct")
    Flowable<HttpWrapper<String>> repay(@Field("phone") String phone, @Field("bankId") String bankId, @Field("bankNum") String bankNum, @Field("borrNum") String borrNum, @Field("optAmount") String optAmout, @Field("triggerStyle") String triggerStyle, @Field("type") int type, @Field("validateCode") String validateCode);

    /**
     * 分享成功
     *
     * @return
     */
    @FormUrlEncoded
    @POST("user/userInviceCoupon")
    Flowable<HttpWrapper<String>> shareSuccess(@Field(Constant.USERID) String per_id);


    /**
     * 银行卡列表
     *
     * @return
     */
    @FormUrlEncoded
    @POST("loan/changeBank")
    Flowable<HttpWrapper<String>> changeBankStatus(@Field(Constant.USERID) String per_id, @Field("bank_num") String bank_num, @Field("md5sign") String md5sign);

    /**
     * 银行卡列表
     *
     * @return
     */
    @POST("user/agreement")
    Flowable<HttpWrapper<String>> getAgreement();

    /**
     * 银行卡列表
     *
     * @return
     */
    @FormUrlEncoded
    @POST("loan/canBinding")
    Flowable<HttpWrapper<String>> canBinding(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);

    /**
     * 银行卡列表
     *
     * @return
     */
    @POST("loan/juxinliInfo")
    Flowable<HttpWrapper<String>> juxinliInfo();

    @FormUrlEncoded
    @POST("loan/getSignPage")
    Flowable<String> getSignHtml(@Field(Constant.USERID) String per_id, @Field("token") String token, @Field("device") String device);

    /**
     * 芝麻
     *
     * @return
     */
    @FormUrlEncoded
    @POST("loan/zhima")
    Flowable<HttpWrapper<String>> zhima(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);

    /**
     * 推送绑定
     *
     * @param per_id
     * @param push_id
     * @param md5sign
     * @return
     */
    @FormUrlEncoded
    @POST("notify/register")
    Flowable<HttpWrapper<String>> commitPushId(@Field(Constant.USERID) String per_id, @Field("push_id") String push_id, @Field("md5sign") String md5sign);

    /**
     * 推送解绑
     *
     * @param per_id
     * @param md5sign
     * @return
     */
    @FormUrlEncoded
    @POST("notify/unregister")
    Flowable<HttpWrapper<String>> unPushId(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);

    @FormUrlEncoded
    @POST("user/getWithdrawInformation")
    Flowable<HttpWrapper<Jinhudai>> getJinhudaiInfo(@Field(Constant.USERID) String per_id, @Field("md5sign") String md5sign);

    /**
     * 得到引流产品
     *
     * @param per_id
     * @return
     */
    @FormUrlEncoded
    @POST("drainage/getDrainage")
    Flowable<HttpWrapperList<DrainageBean>> getDrainage(@Field(Constant.USERID) String per_id);

    /**
     * 得到引流事件
     *
     * @param per_id
     * @return
     */
    @FormUrlEncoded
    @POST("drainage/drainageEvent")
    Flowable<HttpWrapper<String>> drainageEvent(@Field(Constant.USERID) String per_id, @Field("drainage_id") String drainage_id, @Field("event_type") int event_type);

    /**
     * 下载PDF文件
     *
     * @param pdfUrl
     * @return
     */
    @GET()
    Call<ResponseBody> downPDF(@Url String pdfUrl);

    @GET("contract/down/{borrowId}")
    Flowable<HttpWrapper<String>> getContract(@Path("borrowId") String borrowId);

    /**
     * 拿到产品
     *
     * @param userId
     * @param token
     * @param device
     * @return
     */
    @FormUrlEncoded
    @POST("product/getProduct")
    Flowable<HttpWrapper<ProductInfo>> getProduct(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("device") String device, @Field("productId") String productId);

    /**
     * 邀请好友规则接口
     *
     * @return
     */
    @POST("share/rules")
    Flowable<HttpWrapper<InviteRule>> getInviteRule();

    /**
     * 邀请好友佣金接口
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("commission/info")
    Flowable<HttpWrapper<CommissionBean>> getInviteCommission(@Field(Constant.USERID) String userId);

    /**
     * 佣金提现
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("commission/withDraw")
    Flowable<HttpWrapper<String>> inviteCommissionWithdraw(@Field(Constant.USERID) String userId);

    /**
     * 好友邀请列表
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("share/inviter/info")
    Flowable<HttpWrapper<List<InviteBean>>> getInviteList(@Field(Constant.USERID) String userId, @Field("nowPage") int nowPage, @Field("pageSize") int pageSize, @Field("level") int level);

    /**
     * 好友分享
     *
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("share/data")
    Flowable<HttpWrapper<ShareBean>> inviteShare(@Field(Constant.USERID_NEW) String userId);

    @FormUrlEncoded
    @POST("loan/immediate/apply")
    Flowable<HttpWrapper<LoanProApplyBean>> getImmediateApply(@Field("per_id") String userId, @Field("token") String token, @Field("tokenKey") String tokenKey, @Field("device") String device, @Field("productId") int productId);

    @FormUrlEncoded
    @POST("loan/immediate/btn")
    Flowable<HttpWrapper<LoanProApplyBean>> getImmediateBtn(@Field("per_id") String userId, @Field("token") String token, @Field("tokenKey") String tokenKey, @Field("device") String device, @Field("productId") int productId);

    /**
     * 得到支付信息
     *
     * @param userId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("pay/getPayParamByPersonId")
    Flowable<HttpWrapper<PayBean>> getPayInfo(@Field(Constant.USERID) String userId, @Field("token") String token);


    @FormUrlEncoded
    @POST("pay/serviceAmount")
    Flowable<HttpWrapper<String>> pay(@FieldMap() Map<String, String> map);

    /**
     * 账单列表
     *
     * @param userId
     * @param token
     * @param pageNum
     * @param pageSize
     * @return
     */
    @FormUrlEncoded
    @POST("userInfo/getBorrowListByPersonId")
    Flowable<HttpWrapper<List<OrderBean>>> getAmountList(@Field("per_id") String userId, @Field("token") String token, @Field("pageNum") int pageNum, @Field("pageSize") int pageSize, @Field("device") String device, @Field("version") String version);

    /**
     * 账单列表
     *
     * @param userId
     * @param token
     * @param pageNum
     * @param pageSize
     * @return
     */
    @FormUrlEncoded
    @POST("userInfo/getMyCardsByPersonId")
    Flowable<HttpWrapper<List<CardBean>>> getMyCards(@Field("per_id") String userId, @Field("token") String token, @Field("pageNum") int pageNum, @Field("pageSize") int pageSize);

    /**
     * 推荐产品
     *
     * @param userId
     * @param token
     * @return
     */
    @FormUrlEncoded
    @POST("home/recommend")
    Flowable<HttpWrapper<ProductDetailBean>> getRecommend(@Field(Constant.USERID) String userId, @Field("token") String token, @Field("device") String device, @Field("version") String version);

    /**
     * 查询已注册产品
     *
     * @param userId
     * @param token
     * @return
     */

    @FormUrlEncoded
    @POST("user/register/product")
    Flowable<HttpWrapper<List<ProductDetailBean>>> getRegisterProduct(@Field(Constant.USERID) String userId, @Field("token") String token);

    /**
     * @param productId
     * @return 支付状态
     */
    @FormUrlEncoded
    @POST("loan/checkPayFee")
    Flowable<HttpWrapper<String>> getcheckPayFee(@Field("productId") int productId);


}

